<include file="User:header"/>

<style type="text/css">
em { color:#F00; font-style: normal }
.name_d{ color:#F00}
.mess{ font-size:11px; color:#F00}
.oauth li{ float:left}
.oauth li a{color:#FF6000;}
</style>
<script type="text/javascript" src="../Public/js/register.js"></script>
<script type="text/javascript">
function setaa(n){
	if(n==1){
	 document.getElementById('wind_login_1').style.display=" none";
	 document.getElementById('wind_login_2').style.display="";
    }
	if(n==2){
	 document.getElementById('wind_login_1').style.display="";
	 document.getElementById('wind_login_2').style.display=" none";
    }
	
	}

</script>
<!--绑定新账号-->
<div class="wind_login" id="wind_login_1" style="background:url(../Public/images/wind_bks1.png) no-repeat center;display:none" >
  <div class="wind_loginson">
    <div class="wind_logincontent" >
    <form  id="myform2" method="post" action="{:U('User/Register/doreg')}" onsubmit="return change_reg()" >
     <input type="hidden" name="openid" value="{$openid}" />
     <input type="hidden" name="sina_uid" value="{$sina_uid}"/>
        <div style="margin-left:8%; height:50px; line-height:50px;">
          <ul class="oauth">
           <li style="font-size:18px; color:#000; font-weight:bolder">绑定新帐号</li>
           <li style="  margin-left:180px;"><a href="javascript:setaa(1)">绑定已有帐号</a></li>
          </ul>
        </div>
        
      <ul class="wind_zhuce1" style="margin-top:10px;">
        
        <li>选择您的身份类型：</li>
        <li> <select id="group" name="groupid"   style="font-family: '微软雅黑'; width:377px; height:42px;">
                  <option value="">请选择您的身份类型</option>
              <volist name="Role"   id="r">
                 <?php if($r['status']==1){?>
                 <option  value="<?php echo ($r['id'])?>"><?php echo ($r['name'])?></option>
                 <?php } ?>
             </volist>
          </select> 
            <span class="mess" id="group_change"> </span>
          <div style="clear:both;"></div>
        </li>
        
         <li id="name_c">昵称：</li>
        <li><input type="text" name="username" id="name_d" placeholder="昵称" value="" class="reg-form-input rf-input-l"  /><span class="mess"> </span><span class="name_d mess" id=username_change></span> </li>
        
        
        <li>密码：</li>
        <li><input type="password" id="password" name="password" class="reg-form-input rf-input-l" placeholder="登录密码"  /> 
        <span class="mess" id="password_change"> </span></li>
        
        <li>手机号码：</li>
        <li> <input type="text" placeholder="手机号码" value="" id="mobile" name="mobile" class="reg-form-input rf-input-l"  /> 
          <input type="button" style="width: 150px; color:; cursor:pointer" id="btn_mss_r" class="wind_spans4" value="免费获取验证码" />
          <span class="mess" id="mobile_change"> </span>
          </li>
        <li>手机验证：</li>
        <li > 
        
           <div class="auth_code" id="auth_code_yzm" style="display: none">
			            <label style=" height:20px;">
                        <img src="{:U('Home/Index/verify')}" onclick="javascript:resetVerifyCode();" class="checkcode" align="absmiddle"  title="{:L('resetVerifyCode')}" id="verifyImage"/>
                        </label>
			            <label>
			            	<input type="text" value="" class="authCodeText" id="txt_mathcode" name="verifyCode">
							<input type="button" class="autoCodeButton" value="确认" id="btn_mathcode">
			            </label>
			            
			            <em class="arrow_front"></em>
			            <em class="arrow_background"></em>

			          </div>
        <input type="text" name="mobileyzm" id="mobileyzm"  class="reg-form-input rf-input-s" placeholder="请输入验证码"  />       
          <span class="mess" id="yzm_change"> </span>
        </li>
        <script src="__PUBLIC__/Js/jgsat.js"></script>
        <style>
.wind_zhuce1 li{position: relative;}
.mess{position: absolute;
      left: 380px;
	  z-index:99}	
 .auth_code{ 
	position: absolute;
    width: 167px;
    height: 70px;
    background: #f6fff9;
    border: 1px solid #d6ded9;
    display: none;
    top: -160px;
    left: 210px;
    z-index: 100;}
    .auth_code label input.authCodeText {
    float: left;
    width: 80px;
	height:24px;
	line-height:24px;
    text-indent: 5px;}
	
	.auth_code label input.autoCodeButton {
    float: right;
    width: 45px;
    height: 24px;
	line-height:24px;
    border: 1px solid #f36f20;
    background: #dd4f50;
    color: #fff;
    padding: 0;}
	
	.auth_code em {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    font-size: 0;
    display: inline-block;
    border-width: 10px;
    border-color: #f6fff9 transparent transparent transparent;
    border-style: solid dashed dashed dashed;
    z-index: 2;
    bottom: -19px;
    left: 75px;
}	
    .auth_code label {
    width: 145px;
    margin: 6px 0 6px 12px;
    display: block;
    clear: both;
    overflow: hidden;}		
        </style>
        
        
         
       
        <li style="font-size:12px;color:#666;margin: 15px 0px 15px 0px;"> <dd><input name="Iagreen" class="w_check2" type="checkbox" value="1" validate="required:true" />
          我已经认真阅读并同意了餐饮空间的《<a href="index.php?m=Page&a=index&id=13" target="_blank"><span style="color:#FF6000;">使用条款</span></a>》&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </dd>
        </li>
        
         <li style=" width:600px; height:80px;"><input id="wind_spans3" type="submit" value="注册" id="subbnt" style="margin:0;float:left;" />
            
        </li>
       
        
        
      
      </ul>
      </form>
    </div>
  </div>
</div>

<!--绑定已有账号-->
<div class="wind_login" id="wind_login_2" style="background:url(../Public/images/wind_bks1.png) no-repeat center">
  <div class="wind_loginson">
    <div class="wind_logincontent" style="width:480px;">
     <form method="post" action="{:URL('User-Login/dologin')}" name="loginfrm" id="loginfrm">
      <input type="hidden" name="openid" value="{$openid}" />
      <input type="hidden" name="sina_uid" value="{$sina_uid}"/>
        <div style="margin-left:8%; height:50px; line-height:50px;">
          <ul class="oauth">
           <li style="font-size:18px; color:#000; font-weight:bolder">绑定已有帐号</li>
           <li style=" color:#FF6000; margin-left:180px;"><a href="javascript:setaa(2)">绑定新帐号</a></li>
          </ul>
        </div>
      <ul class="wind_loginsonUL" >
        <li>账户：</li>
        <li ><input   type="text" name="username" placeholder="用户名/邮箱/手机号"/></li>
        <li>密码：</li>
        <li><input type="password" name="password" placeholder="请输入密码"></li>
        <li style="font-size:12px;font-weight:bold;"><input type="checkbox" name="cookietime" class="w_check"  value="7776000"/>三个月内免登陆</li>
        <li><input type="submit" class="wind_spans2" value="登录"/></li>
        <li>
          <ul style="float:left;width:49%;">
            <li class="wind_zhuces1">
              <a href="index.php?g=User&m=Register&a=edit">忘记密码</a>&nbsp;&nbsp;&nbsp;&nbsp;
              <a href="{:URL('User-Register/index')}">注册</a>
            </li>
          
          </ul>
         <!-- <ul class="wind_loginsonULson2">
            <li style="margin-bottom:15px;">
              您还可以选择：
            </li>
            <li>
              <img src="../Public/images/windimg3.png" />
            </li>
          </ul>-->
        </li>
      </ul>
      
      <input type="hidden" id="forward" name="forward" value="{$forward}"/>
      </form>
    </div>
  </div>
</div>
 <script type="text/javascript">
$('#btn_mss_r').click(function(){
       var tel = $.trim($('#mobile').val());
	   //alert(tel)
	   if(tel=='' || tel=='手机号码'){alert('请输入您的手机号码')}else{
		   var partten = /^[1][34578][0-9]{9}$/;
		
		   if(partten.test(tel)){
			 document.getElementById('auth_code_yzm').style.display="block";	
		   }else{alert('手机号格式错误')}
	  }
 });


//点击图形验证码后
$('#btn_mathcode').click(function(){
       var tel = $.trim($('#mobile').val());
	   var yzm=$('#txt_mathcode').val();
	   //alert(tel)
	   if(tel=='' || tel=='手机号码'){alert('请输入您的手机号码')}
       var partten = /^[1][34578][0-9]{9}$/;
	   
	  if(partten.test(tel) &&  yzm){
		  $.post('index.php?g=User&m=Sms&a=index&register=1', {'tel':tel,'yzm':yzm},function(res){
              // alert(res);
			  if(res!=0){ 
			      alert('发送失败:'+res);
				 
			  }else{
				    alert('发送成功');
			     time(document.getElementById("btn_mss_r"));
				 
			   }
			  
              });
			  document.getElementById('auth_code_yzm').style.display="";	
	   }//else{alert('请输入手机号')}
 });


$('#btn_mathcode').click(function(){
	
	})

 supportPlaceholder='placeholder'in document.createElement('input'),
  
   //身份
   $('#group').change(function(e){
               // var opts = $('#x>li');
                //opts.removeClass('p');
                for (var i = 0; i <= 2; i++) {
                    if($(this).val()==1) {
                        $("#name_c").html('真实姓名：');
                        $("#name_d").attr('placeholder','真实姓名');
						 if(!supportPlaceholder){ $("#name_d").val('真实姓名');}
					
                    }
					if($(this).val()==2) {
                        $("#name_c").html('昵称：');
                        $("#name_d").attr('placeholder','昵称');
						if(!supportPlaceholder){ $("#name_d").val('昵称');}
						
                    }
                    if($(this).val()==3) {
                        $("#name_c").html('公司名称：');
                        $("#name_d").attr('placeholder','公司名字');
						if(!supportPlaceholder){ $("#name_d").val('公司名字');}
						
                    }
                };
 
            });
			
	
</script>
  
                                                                                                                                                                                                                                                                                                